package threading;

public class ThreadDemo5 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread( () -> {
//            System.out.println("hello t");
            while (true){
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        } );
        System.out.println(thread.getState());
        thread.start();
        Thread.sleep(2000);
        System.out.println(thread.getState());

    }
}